# lit le fichier de configuration
include Makedefs

export COMPIL OPT OPT_COMP SRC OBJ EXEC OPT_DEBUG SRC_FILE EXEC_FILE HEADER_FILE HEADER


# depart
all:  $(EXEC)

# compilation et creation executable
$(EXEC):	$(OBJ)
	@$(COMPIL) $(OPT_COMP) $(OPT_OPT) $(OPT_MU) -o $@ $^
	@echo "compilation $@ ok"

# pre compilation
$(OBJ_FILE)%.o:   $(SRC_FILE)%.cpp
	@clear
	@$(COMPIL) -o $@ -c $< $(OPT_COMP) $(OPT_OPT) $(OPT_MU) -I$(HEADER_FILE) 
	@echo "precompilation $< ok"

# Nettoyage
proper: 
	@rm $(OBJ_FILE)*.o
	@rm $(SRC_FILE).*.swp

clean: proper
	@rm $(EXEC)

# Verif  
tutu: 
	@echo "executable: $(EXEC)"
	@echo "dossier sources: $(SRC_FILE)"
	@echo "dossier .h: $(HEADER_FILE)"
	@echo "dossier executable: $(EXEC_FILE)"
	@echo "fichiers sources: $(SRC)"
	@echo "fichiers objets: $(OBJ)"
	@echo "fichiers .h: $(HEADER)"




